require.config({
	baseUrl: "script",
	// enforceDefine: true,
	paths: {
		"jquery": "jquery.min",
		"highcharts": "highstock",
		"util": "util",
		"highcharts-contextmenu": "highcharts-contextmenu",
		"bootstrap": "http://cdn.bootcss.com/twitter-bootstrap/3.0.3/js/bootstrap.min"
	},
	shim: {
		'jquery': {
			exports: '$'
		},
		'highcharts': {
			deps: ['jquery'],
			exports: '$.fn.highcharts'
		},
		'highcharts-contextmenu': {
			deps: ['highcharts']
		},
		'bootstrap': {
			deps: ['jquery']
		}
	}
});
require(['highcharts-contextmenu', 'util', 'bootstrap'], function(_t0_, _t1_, _t2_){
	$(function() {
		var cssUrl = require.toUrl("./style.css");
		$(window).resize(function(){
			$wh = $(window).height();
			$('#page').height($wh);
			$ch = $wh-$("[role='navigation']").outerHeight();
			$('#left, #center').height($ch);
			$('#main').css({position:'relative', left:0, top:$wh-$ch});
		});
		$(window).resize();
		var isLoading = false,
		$button = $('#button'),
		$container = $('#container');
		$container.highcharts({
			// chart:{
			// 	type:'spline',
			// 	zoomType:'x',
			// 	reflow: true
			// },
			plotOptions:{
				// pie:{
				// 	allowPointSelect: true,
				// 	cursor: 'pointer',
				// 	dataLabels: {enabled: true},
				// 	showInLegend: true
				// }
			},
			xAxis:{
				// categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
			},
			legend:{enabled:true},
			series:[{
					type:'spline',
					id :'dataseries',
					data:[[0,29.9], [1, 71.5], [2, 106.4], [3,129.2], [4,144.0], [5,176.0], [6,135.6], [7,148.5], [8,216.4], [9,194.1], [10,95.6], [11,54.4]]
				}, {
					type:'pie',
					showInLegend:false,
					center:[100, 80],
					size:100,
					dataLabels:{enabled: false},
					data:[{name:'Jan', y:39.9}, {name:'Feb', y:75.5}]
				}, {
					type : 'flags',
					data : [{
						x : 0,
						title : 'A',
						text : 'EURUSD: Bearish Trend Change on Tap?'
					}, {
						x : 11,
						title : 'B',
						text : 'EURUSD: Bearish Trend Change on Tap?'
					}],
					showInLegend:false,
					onSeries:'dataseries',
					shape:'circlepin',
					color:'#5F86B3',
					fillColor:'#5F86B3',
					style:{color:'white'},
					states:{
						hover:{fillColor:'#395C84'}
					},
					width :10
			}]
			// series:[{type:'pie',data:[{name:'Jan', y:39.9}, {name:'Feb', y:75.5}]}]
		});
		var chart = $container.highcharts();
		$button.click(function() {
			var type = chart.series[0].type;
			if(type=='spline'){
				chart.series[0].update({type:'column'});
			}else if(type=='column'){
				chart.series[0].update({type:'area'});
			}else{
				chart.series[0].update({type:'spline'});
			}
			isLoading = ! isLoading;
		});
	});
	// page_main.bind(global)($);
});
